#include<iostream>

int main(){
    using namespace std;
    int a = 10;
    int& b = a;
    int c = 20;

    // a的地址是 0x7ffc4b9aea88  a的值是 10
    // b的地址是 0x7ffc4b9aea88  b的值是 10
    cout << "a的地址是 " << &a << "  a的值是 " << a  << endl;
    cout << "b的地址是 " << &b << "  b的值是 " << b  << endl;
    cout << "\n";
    b = c;

    // c的地址是 0x7ffc4b9aea8c  c的值是 20
    // b的地址是 0x7ffc4b9aea88  b的值是 20
    // a的地址是 0x7ffc4b9aea88  a的值是 20
    cout << "c的地址是 " << &c << "  c的值是 " << c  << endl;
    cout << "b的地址是 " << &b << "  b的值是 " << b  << endl;
    cout << "a的地址是 " << &a << "  a的值是 " << a  << endl;

    return 0;
}